<%@ include file="/platform/common/header.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page import="com.szboanda.platform.v3.workflow.definition.IUser"%>
<%@ page import="com.szboanda.platform.v3.workflow.jdbc.JDBCUsersCache"%>
<link href="<common:webRoot />/resources/platform/oldworkflow/css/oldworkflow.css" rel="stylesheet" type="text/css">
<style>
<!--
.allSteps {width: 280px; border: 1px solid #e8e8e8; height: 24px;}
.rwNum{
	width: 280px;
	display: block;
	float: left;
}

-->
</style>
<script type="text/javascript" src="<common:webRoot/>/resources/platform/oldworkflow/workflow-v2.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot/>/resources/platform/oldworkflow/generatorHelp.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot/>/resources/platform/common/js/workflow.js?v=${sysversion}"></script>
<body>
<!-- <div class="container-full" ng-controller="transitionController"></div> -->
<c:if test="${not empty exception}">
<div class="transitionError">
	<div class="error">
		${exception.message}
	</div>
	<script type="text/javascript">
		$(function(){
			$(".transitionError .stepAttachmentsError").html($(".transitionError .stepAttachmentsError").text() + "<a href='javascript:void(0)' onclick=\"$('#btnAttachmentInfo').click()\">点此</a>进入附件上传页面。");
			$(".transitionError .actionError").each(function(){
				$(this).html($(this).text() + "，<a onclick='underway.gotoAction(\"" + $(this).text() + "\")'>点此</a>办理。");
			});
		});
	</script>
</div>
</c:if>
<c:if test="${empty byWorkflowInfo }">
<div class="underwayMain">
<div class="middle" style="width:99%;">
<div class="contentDiv">
</c:if>
<c:if test="${empty exception}">
<c:if test="${childrensCount == 0}">
	<div class="error">没有可以${optDesc}的步骤，请联系系统管理员!</div>
</c:if>
<c:if test="${childrensCount > 0}">
<!-- <nbean:ajaxUrl clazz="com.szboanda.platform.workflow.service.WorkflowService" method="transition" var="transition"/> -->
<div class="Manual">
     <div class="commonTitle">
     	  <!--<span class="overBtn" onclick="underway.transition()">流转</span>-->
          <p>当前步骤： <b class="">${current.definition.stepDesc}</b></p>
          <p class="resizeNextStep" style="clear: both;">
			  <span style="float: left"><b>下一步骤：</b></span>
			  <span class="rwNum">
				  <c:forEach items="${childrens}" var="child" varStatus="stat">
					  <c:if test="${(oneStep && child.stepId eq childId) || !oneStep}">
						  <label style="cursor: pointer;margin-right:5px;cursor: pointer;margin-right: 5px;max-width: 150px;overflow: hidden;height: 30px;float: left;"
								 title="${child.stepDesc}">
							  <c:if test="${!isCheckbox}">
								<span class="pay_list_c1">
									<input type="radio"	name="nextStepId" value="${child.stepId}" desc="${child.stepDesc}" onclick="underway.selectStep(this)"/>
								</span>
							  </c:if>
							  <c:if test="${isCheckbox}">
								<span class="piaochecked">
									<input type="checkbox" name="nextStepId" value="${child.stepId}" desc="${child.stepDesc}" onclick="underway.selectStep(this)"/></span>
							  </c:if>${child.stepDesc}&nbsp;&nbsp;&nbsp;&nbsp;
						  </label>
					  </c:if>
				  </c:forEach>
			  </span>
		  </p>
        <c:if test="${canUserDefine && !(empty param.chgStep && not empty param.ZBZDYBH)}">
			<p>所有步骤：
				<select name="steps" id="steps" onchange="chgSteps(this);" class="allSteps">
					<option value="">--请选择--</option>
					<c:forEach items="${allSteps}" var="step" varStatus="stat">
						<c:if test="${step.stepId ne stepDef.stepId && !step.lastStep && !step.countersignStep && !step.jointProcessStep}">
							<option value="${step.stepId}" ${currentChildId eq step.stepId ? 'selected' : ''}>${step.stepDesc}</option>
						</c:if>
					</c:forEach>
				</select>
			</p>
		</c:if>
     </div>
     <table class="edit_table" border="0" cellpadding="0" cellspacing="0"> 
     	  <c:forEach items="${childrens}" var="child" varStatus="stat">
     	  	  <c:set var="depts" value="${deptsMap[child.stepId]}" scope="request"/>
     	  	  <c:set var="users" value="${usersMap[child.stepId]}" scope="request"/>
	          <tr id="tr_${child.stepId}" <c:if test="${stat.index > 0}">style="display:none;"</c:if>>
	             <td ${childrensCount > 1 ? "width='120px'" : "width='100px'"}  class="td-label" valign="middle"><b class="stepDesc"></b><font class="mustFlag" color="red">*</font>办理人：</td>
	             <td class="master-div">
	             	<c:if test="${fn:length(users) gt 0}">
	             		<div class="master-user-div" valueTag="#masterUser_${child.stepId}">
		             		<table  class="edit_table" cellspacing="0" cellpadding="0">
			             		<c:forEach var="dept" items="${depts}" varStatus="status">
			             				<tr>
			             					<td class="dept-name">
			             						<c:set var="_tempDeptName" value="${dept.key.deptName}" scope="request"/>
			             						<%
			             							String deptName = request.getAttribute("_tempDeptName") == null ? "" : request.getAttribute("_tempDeptName").toString();
			                                   		int index = deptName.lastIndexOf('/') < 0 ? 0 : deptName.lastIndexOf('/') + 1;
			                                    	request.setAttribute("_deptName", deptName.substring(index, deptName.length()));
			             						%>
			             						<%-- ${dept.key.deptName} --%>
			             						<c:if test="${child.procDefinition.processType ne 'SINGLE_MASTER' }">
			             							<span class="master-dept" deptId="${dept.key.deptId}">${_deptName }：</span>
			             						</c:if>
			             						<c:if test="${child.procDefinition.processType eq 'SINGLE_MASTER' }">
			             							${_deptName }：
			             						</c:if>
			             					</td>
			             					<td>
			             						<c:forEach var="user" items="${dept.value}" varStatus="status">
													<c:if test="${user.valid}" >
														<c:set var="username" value="${empty user.yhcw ? user.userName : user.yhcw }" scope="request"/>
														<c:set value="${user.userId}" var="uId" scope="request"></c:set>
														<%
															String userId = (String)request.getAttribute("uId");
															IUser user = JDBCUsersCache.getInstance().getUser(userId);
															if(user.isInDelegate()){
																IUser delegateUser = JDBCUsersCache.getInstance().getDelegateUser(userId);
																if(!user.getUserId().equals(delegateUser.getUserId())){
																	request.setAttribute("delegateUser", delegateUser);
																}
															}else{
																request.setAttribute("delegateUser", null);
															}
														%>
														<c:if test="${empty delegateUser}">
															<span class="master-user" title="${user.userName }" valueTag="#masterUser_${child.stepId}" deptId="${dept.key.deptId}" type="${child.procDefinition.processType}" userId="${user.userId}" userName="${username}">${username}</span>
														</c:if>
														<c:if test="${not empty delegateUser}">
															<c:set var="delegateUserName" value="${empty delegateUser.yhcw ? delegateUser.userName : delegateUser.yhcw}" scope="request"/>
															<span class="master-user master-user2" title="${username}把任务委托给${delegateUserName}处理" valueTag="#masterUser_${child.stepId}" deptId="${dept.key.deptId}" type="${child.procDefinition.processType}" userId="${delegateUser.userId}" userName="${delegateUserName}"><span style="color: #999;">${username}</span> -> ${delegateUserName}</span>
														</c:if>
													</c:if>
												</c:forEach>
			             					</td>
			             				</tr>
			             		</c:forEach>
	             		    </table>
	             		</div>
	             	</c:if>
	             	<%--<c:if test="${showAllUsers}">
						 <span class="tdIcon m1" onclick="if(isChecked()){underway.selectUsers('#masterUser_${child.stepId}',{'operateType':'transition', 'inputType':'${child.procDefinition.processType}', 'chgStep' : '${param.chgStep}','stepId':'${current.stepId}','nextStepId':'${child.stepId}'});}"></span>
					 </c:if>--%>
	             	<input type="hidden" id="masterUser_${child.stepId}" value="${fn:length(users) eq 1 ? users[0].userId : '' }"/>
	             	<div class="user-select" valueTag="#masterUser_${child.stepId}" opinionTag="#opinion" desc="${child.actionDesc}" 	<%--<c:if test="${showAllUsers}"> ondblclick="if(isChecked()){underway.selectUsers('#masterUser_${child.stepId}',{'operateType':'transition', 'inputType':'${processType}', 'chgStep' : '${param.chgStep}','stepId':'${current.stepId}','nextStepId':'${child.stepId}'});}"  </c:if>--%>>
	             		<c:if test="${fn:length(users) eq 1}">
	             			<span class="user-li" userId="${users[0].userId}" userName="${empty users[0].yhcw ? users[0].userName : users[0].yhcw}"><span>${empty users[0].yhcw ? users[0].userName : users[0].yhcw}</span><%--<span class="user-cut">&nbsp;</span>--%></span>
	             			<script type="text/javascript">
	             				// 解决处理意见未自动带出的问题
	             				setTimeout(function(){
		             				var  showElement = $(".user-select[valueTag='#masterUser_${child.stepId}']");
		             				underway.resetUserValue(showElement);
	             				}, 300);
	             			</script>
	             		</c:if>
	             		<%--<c:if test="${fn:length(users) gt 0}">
             				<span class="user-add ${fn:length(users) ne 1 ? 'user-select-add' : ''}" onmouseenter="if(isChecked('false')){underway.addMasterUser(this,'#masterUser_${child.stepId}');}" onclick="if(isChecked()){underway.addMasterUser(this,'#masterUser_${child.stepId}');}">&nbsp;</span>
             			</c:if>--%>
             			<!-- 添加对默认处理人的选中 -->
             			<c:if test="${!empty defaultUsers && !empty defaultUsers[child.stepId]}">
             			    <c:set var="defaultUser" value="${defaultUsers[child.stepId]}" scope="request"/>
             			    <span class="user-li" userId="${defaultUser.userId}" userName="${empty defaultUser.yhcw ? defaultUser.userName : defaultUser.yhcw}"><span>${empty defaultUser.yhcw ? defaultUser.userName : defaultUser.yhcw}</span><span class="user-cut">&nbsp;</span></span>
             			    <script type="text/javascript">
             					// 解决处理意见未自动带出的问题
             			   		setTimeout(function(){
	                                var  showElement = $(".user-select[valueTag='#masterUser_${child.stepId}']");
	                                underway.resetUserValue(showElement);
             			  		}, 300);
                            </script>
                        </c:if>
             		</div>
	             </td>
	          </tr>
          </c:forEach>
          <tr class="helper_tr" style="display: none;">
             <td class="td-label">协办人：</td>
             <td>
                <span class="tdIcon m1" onclick="underway.selectUsers('#helperUser',{'inputType': 'checkbox'});underway.setOpinion('#helperUser','#opinion');"></span>
                <input type="hidden" id="helperUser"/>
                <div class="user-select" valueTag="#helperUser" opinionTag="#opinion" helper="true"  ondblclick="underway.selectUsers('#helperUser', {'inputType': 'checkbox'});underway.setOpinion('#helperUser','#opinion');"></div>
             </td>
          </tr>
         <%-- <tr>
             <td class="td-label">传阅人：</td>
             <td>
				<span class="tdIcon m1" onclick="underway.selectUsers('#readerUser',{'inputType': 'checkbox'});underway.setOpinion('#readerUser','#opinion');"></span>
             	<input type="hidden" id="readerUser"/>
             	<div class="user-select" valueTag="#readerUser" opinionTag="#opinion" reader="true"  ondblclick="underway.selectUsers('#readerUser', {'inputType': 'checkbox'});underway.setOpinion('#readerUser','#opinion');"></div>
             </td>
          </tr>--%>
         <%-- <c:if test="${canSignature}">
	          <tr>
	               <td class="td-label">${stepDef.signatureDesc}：</td>
	               <td class="signature">
					   <label><span class="pay_list_c1 on"><input type="radio" value="1" name="signature" checked="checked" onclick="underway.changeSignature('${stepDef.agreeDesc}');" desc="${stepDef.agreeDesc}"/></span>${stepDef.agreeDesc}</label>
					   <label><span class="pay_list_c1"><input type="radio" value="0" name="signature" onclick="underway.changeSignature('${stepDef.noAgreeDesc}');" desc="${stepDef.noAgreeDesc}"/></span>${stepDef.noAgreeDesc}</label>
	               </td>
	          </tr>
          </c:if>
          <tr>
             <td class="td-label">快捷操作：
			 </td>
             <td>
				 <span class="tdIcon m2" onclick="underway.selectOpinion('#opinion','${current.stepDefId}','shortCut');;"></span>
				 <div style="border: 1px solid #e8e8e8;min-height: 28px" class="shortCuts" opinionTag="#opinion"></div>
			 </td>
          </tr>--%>
          <tr>
             <td class="td-label"><font color="red">*</font>处理意见：</td>
             <td>
             	<div style="position: relative">
					<span style="position: absolute;right: 0;" class="tdIcon m2" onclick="underway.selectOpinion('#opinion','${definitionId}_${empty WTYHID ? helper.id : WTYHID}');"></span>
					<textarea elastic style="max-height: 80px;min-height: 60px;resize: none" name="opinion" id="opinion" rows="3" class="process-opinion"></textarea>
				</div>
             </td>
          </tr>
          <c:if test="${canSendShortMessage}">
	          <tr>
	             <td class="td-label">发短信：</td>
	             <td><textarea id="messageContent" name="messageContent" rows="3"></textarea></td>
	          </tr>
          </c:if>
     </table>
	<div class="ActionBtnDiv">
		<input class="ActionBtn" type="button" value="${optDesc}" onclick="underway.transition()">
	</div>
</div>
</c:if>
<c:if test="${empty byWorkflowInfo }">
</div>
</div>
</div>
</c:if>

<form id="chgStepForm" name="chgStepForm" action="" method="get">
	<input type="hidden" name="BZBH" value="${BZBH}" />
	<input type="hidden" name="ZBZDYBH" id="ZBZDYBH" value="${ZBZDYBH}" />
	<input type="hidden" name="chgStep" id="chgStep" value="1" />
</form>
<script type="text/javascript">
    $(function () {
        $(".commonTitle .pay_list_c1").unbind("click");
        $(".commonTitle .pay_list_c1").on("click",function(){
            $(this).parent().siblings().find(".on").removeClass("on");
            $(this).addClass("on");
        });

        $(".signature .pay_list_c1").unbind("click");
        $(".signature .pay_list_c1").on("click",function(){
            $(this).parent().siblings().find(".on").removeClass("on");
            $(this).addClass("on");
        });
    })
var currentStepIds = '${currentStepId}';
var isCheckbox = '${isCheckbox}';
var childrensCount = '${childrensCount}';
var processTypes = parseProcessTypes('${processTypes}');
if(childrensCount == '1'){
	var obj = $("input[name='nextStepId']");
	obj.attr('checked', true);
    obj.parent().addClass("on");
	$('#tr_' + obj.val()).show();
	$("input[v][id^='masterUser_']").each(function(){
		this.value = $(this).attr("v");
	});
	// 判断是否显示协办人输入框
	if (null != processTypes && processTypes.length == 1
			&& processTypes[0].processType == 'MIXTURE') {
		$('.helper_tr').show();
	}
}
/**设置意见*/
underway.setOpinion = function(userId,opinionId){
	var userObj = $("div[valueTag='" + userId + "']");
	var opinionObj = $(opinionId);
	var userNames = [];
	var _optionDesc = userId == '#readerUser' ? '共阅' : userId == '#helperUser' ? '协办' : '共阅';
	if(userObj.length > 0){
		var userLi = userObj.find(".user-li");
		userLi.each(function(){
			userNames.push($(this).attr("userName"));
		});
		if(userLi.length > 0){
			opinionObj.attr("readerOpinion",(opinionObj.val() != "" ? "，" : "") + "请" + userNames.join("，") + _optionDesc);
			underway.resetOpinion(opinionObj);
		}
	}
}
/** 修改签字 */
underway.changeSignature = function(signDesc){
	$("#opinion").attr("signatureOpinion",signDesc + "。");
	underway.resetOpinion($("#opinion"));
}
underway.selectStep = function(obj){
 	var len = $("input[name='nextStepId']:checked").length;
 	var valid = true;
	if(isCheckbox == 'true' &&  len == 0){
		$('#tr_' + obj.value).find('.stepDesc').hide();
		$('#tr_' + obj.value).find(".mustFlag").show();
		$('#tr_' + obj.value).find('.stepDesc').text('');
		valid = false;
	}
	if(childrensCount > 1 &&  len == 0){
		$("span[id^='userSpan']").hide();
		$("input[v][id^='masterUser_']").each(function(){
			this.value = '';
		});
		valid = false;
	}
	if(!valid){
		/* $('.piaochecked').removeClass('on_check'); */
		return false;
	}
	// 判断是否显示协办人输入框
	$('.helper_tr').hide();
	$('#helperUser').val('');
	var _clickStepId = $(obj).val();
    if(null != processTypes && processTypes.length > 0) {
        for (var i = 0; i < processTypes.length; i++) {
            if (processTypes[i].stepId == _clickStepId && 
                    processTypes[i].processType == 'MIXTURE') {
            	if (obj.checked) {
            		$('.helper_tr').show();
            	} else {
            		$('.helper_tr').hide();
            		$('#helperUser').val('');
            	}
            }
        }
    }
    // 清空已设置的意见信息
    $('#opinion').attr("masterOpinion", "");
    $('#opinion').attr("readerOpinion", "");
    $('#opinion').attr("helperOpinion", "");
	$("input[name='nextStepId']").each(function(){
		var v = $(this).val();
		if(this.checked){
			/* $(this).parent('.piaochecked').addClass('on_check'); */
			$('#tr_' + v).show();
			if(childrensCount > 1){
				$('#userSpan_' + v).show();
			}
			if(isCheckbox == 'true'){
				var desc = '【' + $(this).attr('desc') + '】';
				$('#tr_' + obj.value).find('.stepDesc').css("display","inline-block");
				$('#tr_' + v).find('.stepDesc').attr("title",desc);
				$('#tr_' + v).find(".mustFlag").hide();
				$('#tr_' + v).find('.stepDesc').html('<font color="red">*</font>' + desc);
			}
			$("input[v][id^='masterUser_" + v + "']").each(function(){
				this.value = $(this).attr("v");
			});
		} else {
			/* $(this).parent('.piaochecked').removeClass('on_check'); */
			$('#tr_' + v).hide();
			if(childrensCount > 1){
				$('#userSpan_' + v).hide();
			}
			$("input[v][id^='masterUser_" + v + "']").each(function(){
				this.value = '';
			});
		}
	});
}
underway.transition = function(){
	if(!isChecked())	return false;
	var arr = $("input[name='nextStepId']:checked");
	var nextStep = "[";
	var flag = true;
	arr.each(function(){
		if(flag){
			var desc = $(this).attr('desc');
			var master = $('#masterUser_' + $(this).val()).val();
			var helper = $("#helperUser").val();
			if(master == '' || master == undefined){
				Common.dialog({
					typr: 'alert',
					content: '没有为步骤[ ' + desc + ' ]设置办理人!', 
				});
				//workflow.alert('没有为步骤【' + desc + '】设置办理人！');
				flag =  false;
			}
			var str = "{";
			str += "'stepId' : '" + $(this).val() + "',";
			str += "'masterUser' : '" + master + "', ";
			str += "'helperUser' : '" + helper + "' ";
			str += "}";
			nextStep += str + ',';
		}
	});
	if(nextStep.indexOf(',') > 0){
		nextStep = nextStep.substring(0, nextStep.length - 1);
	}
	nextStep += "]";
	if(!flag){
		return false;
	}
	var opinion = $("#opinion").val();
	if(opinion.trim() == ''){
		Common.dialog({
			typr: 'alert',
			content: '请输入处理意见!',
		});
		//workflow.alert('请输入处理意见!');
		return false;
	}
	var signature = $("input[name='signature']:checked").val();
	var messageContent = $("#messageContent").val();
	var readerUser = $("#readerUser").val();
	var transitionData = {'chgStep':'${param.chgStep}','childId':'${param.ZBZDYBH}','readerUser' : readerUser, 'nextStep': nextStep, 'currentStepId':currentStepIds,'opinion':opinion,'messageContent':messageContent,'signature':signature};
	//var ret = DomUtils.ajaxRequest('${transition}',{'chgStep':'${param.chgStep}','childId':'${param.ZBZDYBH}','readerUser' : readerUser, 'nextStep': nextStep, 'currentStepId':currentStepIds,'opinion':opinion,'messageContent':messageContent,'signature':signature});
	var ret = OldWorkflow.transition(transitionData);
	if(ret != null){
		if(ret.result == 'true'){
			<c:if test="${not empty byWorkflowInfo }">
		 	var idx = Common.dialog({
				type: 'msg',
				style: 1,
				content: '${optDesc}成功!', 
				callback: function(){
					// demo中存在弹出页面情况，做兼容
                    if (window.parent.helper) {
                        window.parent.helper.refreshPage();
                    } else if (window.parent.parent.helper) {
                        window.parent.parent.helper.refreshPage();
                    }
                    if (window.top.needCloseTransitionDialog) {
                        Common.dialog({type:'close', index: window.top.transitionDialogId});
                    }else if(TOP_WINDOW.window.transitionDialogId){
                    	Common.dialog({type:'close', index: TOP_WINDOW.window.transitionDialogId});
                    }
					Common.dialog({type:'close', index: idx});
				}
		 	});
				//window.parent.underway.refresh('流转成功！');
			</c:if>
			<c:if test="${empty byWorkflowInfo }">
			var idx = Common.dialog({
				type: 'msg',
				style: 1,
				content: '${optDesc}成功!', 
				callback: function(){
					if(window.opener == undefined){ //IE
						window.returnValue = "transition";
					}else{ //谷歌
						window.opener.returnValue = "transition";
					}
					Common.dialog({type:'close', index: idx});
				}
		 	});
			</c:if>
		}else if(ret.result == 'false' && ret.message != ''){
			Common.dialog({
				typr: 'alert',
				content: ret.message,
			});
			//workflow.alert(ret.message);
		}
	}
}
underway.checkUser = function(obj,id){
	if($(obj).attr('type') == 'radio'){
		$("#" + id).val($(obj).val());
		$("#" + id + "_name").val($(obj).attr("userName"));
	}else if($(obj).attr('type') == 'checkbox'){
		var value = '';
		var name = '';
		$("input[name='group_" + id + "']:checked").each(function(){
			value += $(this).val() + ',';
			name += $(this).attr("userName") + ',';
		});	
		if(value != ''){
			value = value.substring(0, value.length - 1);
			name = name.substring(0, name.length - 1);
		}
		$("#" + id).val(value);
		$("#" + id + "_name").val(name);
	}
}
function isChecked(show){
	var arr = $("input[name='nextStepId']:checked");
	if(arr.length == 0){
		if(show != "false")
			Common.dialog({
				typr: 'alert',
				content: '请选择${optDesc}的下一步骤!',
			});
			//workflow.alert('请选择流转的下一步骤！');
		return false;
	}
	return true;
}
$(function(){
	underway.renderShortCuts('#opinion','${current.stepDefId}');
	$("input[name='signature']:checked").each(function(){
		$("#opinion").attr("signatureOpinion",$(this).attr("desc") + "。");
		underway.resetOpinion($("#opinion"));
	});
	<c:if test="${empty param.byWorkflowInfo }">
		underway.initUser();
	</c:if>
	
	var rHeight = $('.resizeNextStep .rwNum').height() + 'px';
	$('.resizeNextStep').height(rHeight);
})

function chgSteps(obj){
	$('#ZBZDYBH').val(obj.value);
	var childId = $('#ZBZDYBH').val();
	var chgStep = $('#chgStep').val();
	var url = Common.webRoot() + '/platform/workflowpagecontroller/transitionpage/';
	url += currentStepIds + '/${batch}/' + childId + '/' + chgStep;
	$('#chgStepForm').attr('action', url);
	$('#chgStepForm').submit(); 
	//document.chgStepForm.submit();
}

function parseProcessTypes(processTypesMap) {
	if((typeof processTypesMap != 'string') || processTypesMap.constructor != String) {
		return [];
	}
	var _processTypes = [];
	processTypesMap = processTypesMap.substring(1, processTypesMap.length - 1);
	var splitFirst = processTypesMap.split(',');
	if(splitFirst != null && splitFirst.length > 0) {
		for(var i = 0; i < splitFirst.length; i++) {
			var mapStr = splitFirst[i];
			var splitSecond = mapStr.split('=');
			if(null == splitSecond || splitSecond.length != 2) {
				continue;
			}
			_processTypes.push({'stepId': $.trim(splitSecond[0]), 
				'processType': $.trim(splitSecond[1])});
		}
	}
	return _processTypes;
}
</script>
</c:if>
<script type="text/javascript" src="<common:webRoot/>/resources/platform/oldworkflow/transition.js?v=${sysversion}"></script>
</body>
<%@ include file="/platform/common/footer.jsp" %>